#ifndef WATCH_H
#define WATCH_H

#include <QPixmap>
#include <QPainter>
#include <QPen>
#include <QDateTime>
#include <QPair>

#include "config.h"

namespace Watch {       // 该名字空间负责钟表的绘制

    class Watch {       // Watch类是一个钟表
    public:
        explicit Watch(QPoint pos, int sz =wch_sz, QPair<double,QColor> border =wch_border, QFont font =wch_font, double font_pos =wch_font_pos) : center{pos}, radius{sz}, bder{border}, ft{font}, fpos{font_pos} { }
        void draw(QPixmap* dest) const;     // 绘制此时的时间
    private:
        QPoint center;
        int radius;
        QPair<double,QColor> bder;
        QFont ft;
        double fpos;
        void draw_back(QPixmap* dest) const;        // 绘制表盘
        void draw_hand(QPixmap* dest) const;        // 绘制表针
        void draw_hand(QPixmap* dest, int index, double angle) const;       // 绘制“时分秒”中第index个表针，角度为angle。dest必须非空
    };

}

#endif // WATCH_H
